package com.wugh.fast.demo.config;

import com.wugh.fast.module.async.service.TaskService;
import com.wugh.fast.module.async.service.impl.DefaultTaskService;
import com.wugh.fast.module.async.storage.impl.RedisTaskStorage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * 说明:
 *
 * @author wugh
 * @date 2020-04-14 10:11
 */
@Configuration
public class TaskConfig {
    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    @Bean
    public TaskService taskService() {
        return new DefaultTaskService(new RedisTaskStorage(redisTemplate));
    }
}
